// [[ OnflowGenerator Entity UUID: c1b1ff567c4340698cd215a691137c91 ]]
package com.itdct.onflow.system.log.entity

import com.baomidou.mybatisplus.annotation.TableName
import com.itdct.onflow.core.annotation.Column
import com.itdct.onflow.core.annotation.ColumnRelateDict
import com.itdct.onflow.core.annotation.ColumnRelateId
import com.itdct.onflow.core.annotation.TableDescription
import com.itdct.onflow.core.entity.IdEntity
import com.itdct.onflow.system.account.entity.SysAccountEntity
import java.util.*

/**
 * @author Zhouwx
 * @date 2025/8/25 13:58:32
 * @version 1.0
 * @description
 */
@TableDescription("系统登录日志")
@TableName("sys_login_log")
class SysLoginLogEntity : IdEntity() {
    @ColumnRelateId(targetClass = SysAccountEntity::class, targetFieldName = "name")
    @Column(comment = "账号id", nullable = false, sort = 10)
    var accountId = 0L

    @Column(comment = "登录时间", nullable = false, sort = 20)
    var loginTime: Date? = null

    @ColumnRelateDict(dictCode = "sysLoginResult")
    @Column(comment = "登录结果", nullable = false, sort = 30)
    var result = 0

    @Column(comment = "登录IP地址", length = 60, sort = 50)
    var ipAddress = ""

    @Column(comment = "登录失败原因", length = 200, nullable = false, sort = 40)
    var failReason = ""

    @ColumnRelateDict(dictCode = "platformType")
    @Column(comment = "平台类型", nullable = false, length = 100, defaultValue = "onflow-backend", indexed = true, sort = 30)
    var platformType = ""

}